package com.shanzmoo.open.server.api.web;

import com.shanzmoo.base.bean.SHttpResponse;
import com.shanzmoo.core.domain.OssCallbackVO;
import com.shanzmoo.core.domain.OssPolicyVO;
import com.shanzmoo.core.manager.base.OssManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Oss相关操作接口
 * @author Gzhao
 * @date 2020/12/1
 */
@Slf4j
@Api(tags = "系统-Oss管理")
@RestController
@RequestMapping("/open/oss")
public class OssController {

    @Autowired
    private OssManager ossManager;

    @ApiOperation(value = "oss上传成功回调")
    @PostMapping(value = "callback")
    public SHttpResponse<OssCallbackVO> callback(HttpServletRequest request) {
        log.info("oss callback回调成功......");
        return SHttpResponse.ok(ossManager.callback(request));
    }

}
